package com.example.demo.entity;

import java.math.BigDecimal;
import java.util.Date;

public class Goods {

    /**
     * 商品ID
     */
    private Integer id;
    /**
     * 商品编码
     */
    private String bn;
    /**
     * 商品名称
     */
    private String name;
    /**
     * 商品简介
     */
    private String brief;
    /**
     * 商品价格
     */
    private BigDecimal price;
    /**
     * 成本价
     */
    private BigDecimal costprice;
    /**
     * 市场价
     */
    private BigDecimal mktprice;
    /**
     * 集赞价
     */
    private BigDecimal fabs_price;
    /**
     * 默认图片 图片id
     */
    private Integer image_id;
    /**
     * 默认图片的请求路径
     */
    private String imageurl;
    /**
     * 商品分类ID 关联category.id
     */
    private Integer goods_cat_id;
    /**
     * 商品类别ID 关联goods_type.id
     */
    private Integer goods_type_id;
    /**
     * 品牌ID 关联brand.id
     */
    private Integer brand_id;
    /**
     * 虚拟正常商品 1=正常 2=虚拟
     */
    private Integer is_nomal_virtual;
    /**
     * 上架标志 1=上架 2=下架
     */
    private Integer marketable;
    /**
     * 库存
     */
    private Integer stock;
    /**
     * 冻结库存
     */
    private Integer freeze_stock;
    /**
     * 重量
     */
    private BigDecimal weight;
    /**
     * 商品单位
     */
    private String unit;
    /**
     * 商品详情
     */
    private String intro;
    /**
     * 商品规格序列号存储
     */
    private String spes_desc;
    /**
     * 参数序列化
     */
    private String params;
    /**
     * 评论次数
     */
    private Integer comments_count;
    /**
     * 浏览次数
     */
    private Integer view_count;
    /**
     * 购买次数
     */
    private Integer buy_count;
    /**
     * 上架时间
     */
    private Date uptime;
    /**
     * 下架时间
     */
    private Date downtime;
    /**
     * 商品排序 越小越靠前
     */
    private Integer sort;
    /**
     * 是否推荐，1是，2不是推荐
     */
    private Integer is_recommend;
    /**
     * 是否热门，1是，2否
     */
    private Integer is_hot;
    /**
     * 标签id逗号分隔
     */
    private String label_ids;
    /**
     * 创建时间
     */
    private Date ctime;
    /**
     * 更新时间
     */
    private Date utime;
    /**
     * 删除标志 有数据表示删除
     */
    private Long isdel;
    /**
     * 是否集赞商品
     */
    private Long isfabulous;
    /**
     * 达标集赞数量
     */
    private Integer fabulous_num;

    public Goods(){}

    public Goods(Jshop_goods good,String imageurl){
        this.id = good.getId();
        this.bn = good.getBn();
        this.name = good.getName();
        this.brief = good.getBrief();
        this.price = good.getPrice();
        this.costprice = good.getCostprice();
        this.mktprice = good.getMktprice();
        this.fabs_price = good.getFabs_price();
        this.image_id = good.getImage_id();
        this.imageurl = imageurl; //获取imageurl
        this.goods_cat_id = good.getGoods_cat_id();
        this.goods_type_id = good.getGoods_type_id();
        this.brand_id = good.getBrand_id();
        this.is_nomal_virtual = good.getIs_nomal_virtual();
        this.marketable = good.getMarketable();
        this.stock = good.getStock();
        this.freeze_stock = good.getStock();
        this.weight = good.getWeight();
        this.unit = good.getUnit();
        this.intro = good.getIntro();
        this.spes_desc = good.getSpes_desc();
        this.params = good.getParams();
        this.comments_count = good.getComments_count();
        this.view_count = good.getView_count();
        this.buy_count = good.getBuy_count();
        this.uptime = good.getUptime();
        this.downtime = good.getDowntime();
        this.sort = good.getSort();
        this.is_recommend = good.getIs_recommend();
        this.is_hot = good.getIs_hot();
        this.label_ids = good.getLabel_ids();
        this.ctime = good.getCtime();
        this.utime = good.getUtime();
        this.isdel = good.getIsdel();
        this.isfabulous = good.getIsfabulous();
        this.fabulous_num = good.getFabulous_num();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBn() {
        return bn;
    }

    public void setBn(String bn) {
        this.bn = bn;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBrief() {
        return brief;
    }

    public void setBrief(String brief) {
        this.brief = brief;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getCostprice() {
        return costprice;
    }

    public void setCostprice(BigDecimal costprice) {
        this.costprice = costprice;
    }

    public BigDecimal getMktprice() {
        return mktprice;
    }

    public void setMktprice(BigDecimal mktprice) {
        this.mktprice = mktprice;
    }

    public BigDecimal getFabs_price() {
        return fabs_price;
    }

    public void setFabs_price(BigDecimal fabs_price) {
        this.fabs_price = fabs_price;
    }

    public Integer getImage_id() {
        return image_id;
    }

    public void setImage_id(Integer image_id) {
        this.image_id = image_id;
    }

    public String getImageurl() {
        return imageurl;
    }

    public void setImageurl(String imageurl) {
        this.imageurl = imageurl;
    }

    public Integer getGoods_cat_id() {
        return goods_cat_id;
    }

    public void setGoods_cat_id(Integer goods_cat_id) {
        this.goods_cat_id = goods_cat_id;
    }

    public Integer getGoods_type_id() {
        return goods_type_id;
    }

    public void setGoods_type_id(Integer goods_type_id) {
        this.goods_type_id = goods_type_id;
    }

    public Integer getBrand_id() {
        return brand_id;
    }

    public void setBrand_id(Integer brand_id) {
        this.brand_id = brand_id;
    }

    public Integer getIs_nomal_virtual() {
        return is_nomal_virtual;
    }

    public void setIs_nomal_virtual(Integer is_nomal_virtual) {
        this.is_nomal_virtual = is_nomal_virtual;
    }

    public Integer getMarketable() {
        return marketable;
    }

    public void setMarketable(Integer marketable) {
        this.marketable = marketable;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getFreeze_stock() {
        return freeze_stock;
    }

    public void setFreeze_stock(Integer freeze_stock) {
        this.freeze_stock = freeze_stock;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public String getSpes_desc() {
        return spes_desc;
    }

    public void setSpes_desc(String spes_desc) {
        this.spes_desc = spes_desc;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public Integer getComments_count() {
        return comments_count;
    }

    public void setComments_count(Integer comments_count) {
        this.comments_count = comments_count;
    }

    public Integer getView_count() {
        return view_count;
    }

    public void setView_count(Integer view_count) {
        this.view_count = view_count;
    }

    public Integer getBuy_count() {
        return buy_count;
    }

    public void setBuy_count(Integer buy_count) {
        this.buy_count = buy_count;
    }

    public Date getUptime() {
        return uptime;
    }

    public void setUptime(Date uptime) {
        this.uptime = uptime;
    }

    public Date getDowntime() {
        return downtime;
    }

    public void setDowntime(Date downtime) {
        this.downtime = downtime;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getIs_recommend() {
        return is_recommend;
    }

    public void setIs_recommend(Integer is_recommend) {
        this.is_recommend = is_recommend;
    }

    public Integer getIs_hot() {
        return is_hot;
    }

    public void setIs_hot(Integer is_hot) {
        this.is_hot = is_hot;
    }

    public String getLabel_ids() {
        return label_ids;
    }

    public void setLabel_ids(String label_ids) {
        this.label_ids = label_ids;
    }

    public Date getCtime() {
        return ctime;
    }

    public void setCtime(Date ctime) {
        this.ctime = ctime;
    }

    public Date getUtime() {
        return utime;
    }

    public void setUtime(Date utime) {
        this.utime = utime;
    }

    public Long getIsdel() {
        return isdel;
    }

    public void setIsdel(Long isdel) {
        this.isdel = isdel;
    }

    public Long getIsfabulous() {
        return isfabulous;
    }

    public void setIsfabulous(Long isfabulous) {
        this.isfabulous = isfabulous;
    }

    public Integer getFabulous_num() {
        return fabulous_num;
    }

    public void setFabulous_num(Integer fabulous_num) {
        this.fabulous_num = fabulous_num;
    }

    @Override
    public String toString() {
        return "goods{" +
                "id=" + id +
                ", bn='" + bn + '\'' +
                ", name='" + name + '\'' +
                ", brief='" + brief + '\'' +
                ", price=" + price +
                ", costprice=" + costprice +
                ", mktprice=" + mktprice +
                ", fabs_price=" + fabs_price +
                ", image_id=" + image_id +
                ", imageurl='" + imageurl + '\'' +
                ", goods_cat_id=" + goods_cat_id +
                ", goods_type_id=" + goods_type_id +
                ", brand_id=" + brand_id +
                ", is_nomal_virtual=" + is_nomal_virtual +
                ", marketable=" + marketable +
                ", stock=" + stock +
                ", freeze_stock=" + freeze_stock +
                ", weight=" + weight +
                ", unit='" + unit + '\'' +
                ", intro='" + intro + '\'' +
                ", spes_desc='" + spes_desc + '\'' +
                ", params='" + params + '\'' +
                ", comments_count=" + comments_count +
                ", view_count=" + view_count +
                ", buy_count=" + buy_count +
                ", uptime=" + uptime +
                ", downtime=" + downtime +
                ", sort=" + sort +
                ", is_recommend=" + is_recommend +
                ", is_hot=" + is_hot +
                ", label_ids='" + label_ids + '\'' +
                ", ctime=" + ctime +
                ", utime=" + utime +
                ", isdel=" + isdel +
                ", isfabulous=" + isfabulous +
                ", fabulous_num=" + fabulous_num +
                '}';
    }
}
